
// <copyright file="CounterCategoryInfoComparer.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The counter category info comparer.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Diagnostics.Performance.Dtos
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The counter category info comparer.
    /// </summary>
    public sealed class CounterCategoryInfoComparer : IComparer<CounterCategoryInfo>
    {
        #region Static Fields

        /// <summary>
        /// The instance.
        /// </summary>
        private static readonly CounterCategoryInfoComparer InstanceObject = new CounterCategoryInfoComparer();

        #endregion Static Fields

        #region Constructors and Finalizers

        /// <summary>
        /// Prevents a default instance of the <see cref="CounterCategoryInfoComparer"/> class from being created.
        /// </summary>
        private CounterCategoryInfoComparer()
        {
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets the instance.
        /// </summary>
        public static CounterCategoryInfoComparer Instance
        {
            get
            {
                return InstanceObject;
            }
        }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The compare.
        /// </summary>
        /// <param name="x">
        /// The x.
        /// </param>
        /// <param name="y">
        /// The y.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public int Compare(CounterCategoryInfo x, CounterCategoryInfo y)
        {
            return string.Compare(x.CategoryName, y.CategoryName, StringComparison.Ordinal);
        }

        #endregion Public Methods and Operators
    }
}